package cn.glutnn.subject.application.convert;

import cn.glutnn.subject.application.dto.SubjectCategoryDTO;
import cn.glutnn.subject.domain.enyity.SubjectCategoryBO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * Author:   msh
 * Date:     2024/11/21 下午2:15
 * Description:
 */
@Mapper
public interface SubjectCategoryDTOConverter {
    SubjectCategoryDTOConverter INSTANCE = Mappers.getMapper(SubjectCategoryDTOConverter.class);

    @Mapping(source = "labelDTOList", target = "labelBOList")
    SubjectCategoryBO convertDtoToBo(SubjectCategoryDTO subjectCategoryDTO);

    @Mapping(source = "labelBOList", target = "labelDTOList")
    SubjectCategoryDTO convertBoToDto(SubjectCategoryBO subjectCategoryBO);

    @Mapping(source = "count", target = "count")
    @Mapping(source = "labelBOList", target = "labelDTOList")
    List<SubjectCategoryDTO> convertBoListToDtoList(List<SubjectCategoryBO> subjectCategoryBOList);
}
